package com.fingard.dsp.bank.reqrespobj.batchbill;

import com.fingard.dsp.bank.reqrespobj.ReqRespHeader;
import com.fingard.dsp.bank.reqrespobj.RetAtsBase;
import com.fingard.dsp.bank.reqrespobj.batchbill.detail.RetAtsBatchQryDetail;
import com.fingard.xml.XmlTextWriter;

/**
 * Created by F on 2019/10/20.
 */
public class RetAtsBatchQry extends RetAtsBase {
    public String respCode;
    public String respInfo;


    public RetAtsBatchQry(ReqRespHeader p_header) {
        retHeader = p_header;
        retXmlWriter = new XmlTextWriter();//用于输出返回ATS的XML报文
    }


    public void writeBefore() {
        writeStart();//写返回ATS的统一头部信息
        retXmlWriter.writeElementString("RespCode", respCode);
        retXmlWriter.writeElementString("RespInfo", respInfo);
    }

    public void writeAfter() {
        writeEnd();
    }

    public void writeDetail(RetAtsBatchQryDetail detail) {
        retXmlWriter.writeStartElement("DetailRecord");

        retXmlWriter.writeElementString("BatchNo", detail.batchNo);
        retXmlWriter.writeElementString("DrawName", detail.drawName);
        retXmlWriter.writeElementString("DrawAct", detail.drawAct);
        retXmlWriter.writeElementString("DrawBnkName", detail.drawBnkName);
        retXmlWriter.writeElementString("DrawBnkCode", detail.drawBnkCode);
        retXmlWriter.writeElementString("BillType", detail.billType);
        retXmlWriter.writeElementString("BankType", detail.bankType);
        retXmlWriter.writeElementString("AccpBrch", detail.accpBrch);
        retXmlWriter.writeElementString("AccpBranch", detail.accpBranch);
        retXmlWriter.writeElementString("AccpBnkCode", detail.accpBnkCode);
        retXmlWriter.writeElementString("AccpAccount", detail.accpAccount);
        retXmlWriter.writeElementString("AccpName", detail.accpName);
        retXmlWriter.writeElementString("BatchStatus", detail.batchStatus);
        retXmlWriter.writeElementString("TransFlag", detail.transFlag);
        retXmlWriter.writeElementString("BillNum", detail.billNum);
        retXmlWriter.writeElementString("BatchMoney", detail.batchMoney);
        retXmlWriter.writeElementString("ProtocolNo", detail.protocolNo);
        retXmlWriter.writeElementString("Poundage", detail.poundage);
        retXmlWriter.writeElementString("Reserved1", detail.reserved1);
        retXmlWriter.writeElementString("Reserved2", detail.reserved2);
        retXmlWriter.writeEndElement();
    }
}
